package xing.appwidget.main

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import android.widget.PopupWindow
import androidx.appcompat.app.AppCompatActivity
import xing.appwidget.bean.PackageFilterParam
import xing.appwidget.databinding.PopMainMoreBinding
import xing.appwidget.label.LabelManagerFragment

class MainMorePopupWindow(val activity: AppCompatActivity) : PopupWindow(activity) {
    private val binding: PopMainMoreBinding

    init {
        binding = PopMainMoreBinding.inflate(LayoutInflater.from(activity))
        contentView = binding.root
        isFocusable = true
        isOutsideTouchable = true
        setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))

        initBtnClick()
    }

    fun initBtnClick() {
        binding.tvLabel.setOnClickListener {
            LabelManagerFragment.start(activity, true)
            dismiss()
        }
    }

    fun setData(filter: PackageFilterParam): MainMorePopupWindow {
        return this
    }

}